package com.ruoyi.ism.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ism.mapper.IsmActivityPublishMapper;
import com.ruoyi.ism.domain.IsmActivityPublish;
import com.ruoyi.ism.service.IIsmActivityPublishService;

/**
 * 活动发布Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-18
 */
@Service
public class IsmActivityPublishServiceImpl implements IIsmActivityPublishService 
{
    @Autowired
    private IsmActivityPublishMapper ismActivityPublishMapper;

    /**
     * 查询活动发布
     * 
     * @param activityId 活动发布主键
     * @return 活动发布
     */
    @Override
    public IsmActivityPublish selectIsmActivityPublishByActivityId(Long activityId)
    {
        return ismActivityPublishMapper.selectIsmActivityPublishByActivityId(activityId);
    }

    /**
     * 查询活动发布列表
     * 
     * @param ismActivityPublish 活动发布
     * @return 活动发布
     */
    @Override
    public List<IsmActivityPublish> selectIsmActivityPublishList(IsmActivityPublish ismActivityPublish)
    {
        return ismActivityPublishMapper.selectIsmActivityPublishList(ismActivityPublish);
    }

    /**
     * 新增活动发布
     * 
     * @param ismActivityPublish 活动发布
     * @return 结果
     */
    @Override
    public int insertIsmActivityPublish(IsmActivityPublish ismActivityPublish)
    {
        ismActivityPublish.setCreateTime(DateUtils.getNowDate());
        return ismActivityPublishMapper.insertIsmActivityPublish(ismActivityPublish);
    }

    /**
     * 修改活动发布
     * 
     * @param ismActivityPublish 活动发布
     * @return 结果
     */
    @Override
    public int updateIsmActivityPublish(IsmActivityPublish ismActivityPublish)
    {
        ismActivityPublish.setUpdateTime(DateUtils.getNowDate());
        return ismActivityPublishMapper.updateIsmActivityPublish(ismActivityPublish);
    }

    /**
     * 批量删除活动发布
     * 
     * @param activityIds 需要删除的活动发布主键
     * @return 结果
     */
    @Override
    public int deleteIsmActivityPublishByActivityIds(Long[] activityIds)
    {
        return ismActivityPublishMapper.deleteIsmActivityPublishByActivityIds(activityIds);
    }

    /**
     * 删除活动发布信息
     * 
     * @param activityId 活动发布主键
     * @return 结果
     */
    @Override
    public int deleteIsmActivityPublishByActivityId(Long activityId)
    {
        return ismActivityPublishMapper.deleteIsmActivityPublishByActivityId(activityId);
    }
}
